Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix spurious seeding by switching to keyword args. #876

Merged

Conversation

jan-matthis
Copy link
Contributor

simulate_for_sbi calls simulate_in_batches with wrong positional arguments: 5afd40b added seed as an extra argument for simulate_in_batches which was not reflected at the call site. Thus, show_progress_bar (defaulting to True) is erroneously used as the value for seed. This PR proposes to fix the resulting spurious seeding by switching from positional to keyword arguments.

Copy link
Contributor

@michaeldeistler michaeldeistler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks! Is there a reason to not allow passing the seed to simulate_for_sbi()?

@codecov
Copy link

codecov bot commented Oct 2, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (6c4fa7a) 75.58% compared to head (6d0629e) 75.58%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #876   +/-   ##
=======================================
  Coverage   75.58%   75.58%           
=======================================
  Files          80       80           
  Lines        6254     6254           
=======================================
  Hits         4727     4727           
  Misses       1527     1527           
Flag Coverage Δ
unittests 75.58% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
sbi/inference/base.py 85.61% <ø> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jan-matthis
Copy link
Contributor Author

Sure, that also works -- added it in.

@michaeldeistler michaeldeistler merged commit 0dc8922 into sbi-dev:main Oct 12, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants